<template>
  <div>
    <TbTitle title="（二）、业务活动表" />
    <div style="line-height: 40px;">单位：元</div>
    <table border="" class="m-table">
      <tr>
        <td rowspan="2" style="width: 17.5%;">项目</td>
        <td rowspan="2" style="width: 7%;">行次</td>
        <td colspan="3">上年末数</td>
        <td colspan="3">本年累计数</td>
      </tr>
      <tr>
        <td style="width: 12.5%;">非限定性</td>
        <td style="width: 12.5%;">限定性</td>
        <td style="width: 12.5%;">合计</td>
        <td style="width: 12.5%;">非限定性</td>
        <td style="width: 12.5%;">限定性</td>
        <td style="width: 12.5%;">合计</td>
      </tr>
      <template v-for="(item, index) in detailInfo">
        <tr v-if="item.fieldSort == 1 || item.fieldSort == 10">
          <td colspan="8">{{ item.assetTermName }}</td>
        </tr>
        <tr v-else>
          <td>
            {{ item.assetTermName }}
          </td>
          <td>{{ item.fieldSort }}</td>
          <td>
            {{ item.upEndBalanceUnrestricted }}
          </td>
          <td>
            {{ item.upEndBalanceRestrict }}
          </td>
          <td>
            {{ item.upEndBalanceCount }}
          </td>
          <td>
            {{ item.thisYearUnrestricted }}
          </td>
          <td>
            {{ item.thisYearRestrict }}
          </td>
          <td>
            {{ item.thisYearCount }}
          </td>
        </tr>
      </template>
    </table>
  </div>
</template>

<script setup lang="ts">
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
import { reactive, inject } from 'vue'

let detailInfo = reactive([])
const { getDetailInfo } = inject('getDetailInfo')

getDetailInfo().then(res => {
  Object.assign(detailInfo, res.data)
})

</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;
  font-family: '微软雅黑';
}

table {
  border-spacing: 0px;
  width: 100%;
  border-top: 1px solid #999;
  border-left: 1px solid #999;
  color: #000;

  thead {
    background: #f5f7fa;
    color: rgb(37, 43, 53);

    th {
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      text-align: center;
      height: 40px;
    }
  }

  tbody {
    td {
      height: 40px;
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      text-align: center;

      &.td-head {
        background: #f5f7fa;
      }
    }
  }
}
</style>
